﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Internet_Deliver_Therapy.Controllers;
using Internet_Deliver_Therapy.Controllers.Patient;

namespace Internet_Deliver_Therapy.Views.Admin
{
    public partial class PsychologistsManagement : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //Ensure that user login before being able to access the secure pages
            if (Session["Email"] != null)
            {
                string loginUserEmail = Session["Email"].ToString();

                UsersController userController = new UsersController();
                //string loginUserFirstName = userController.getUserFirstName(loginUserEmail);
                //lblUserFirstName.Text = loginUserFirstName;
            }
            else
            {
                Response.Redirect("~/Views/Index/Login.aspx");
            }

            if (!this.IsPostBack)
            {
                ddlSearchBy.Items.Add("Psychiatrist");
                ddlSearchBy.Items.Add("Total No. of Patients");
                ddlSearchBy.Items.Add("Status");

                PatientController patientController = new PatientController();
                lblTotalPatients.Text = patientController.totalActivePatients().ToString();
            }

        }

        protected void Register_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Views/Admin/Psychologist/RegisterPsychologist.aspx");
        }

        protected void logout(object sender, EventArgs e)
        {
            Session.Clear();
            Response.Redirect("~/Views/Index/Login.aspx");
        }
    }
}